<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
<%@ include file="/WEB-INF/jsp/inc/taglibs.jsp"%>
	<%@ include file="/WEB-INF/jsp/inc/meta.jsp"%>  
	<script type="text/javascript">
$(function () {
	onloadtree();
});
</script>
<script type="text/javascript">

function onloadtree(){
      $.ajax({
	   	url:'${approot}/admin/caitype/dept_tree',
	   	dataType: 'json',
	   	contentType: 'application/json',
		type:'post',
		beforeSend:function(){
	   	
		},
		error:function(request){
			//alert(request.responseText);
		},
		success:function(data){
			loadtree(data.tree);
		}
	   });
}


function loadtree(html) {
	//alert(html);
	//alert('dd');
	$("#catetree").jstree({ 
		"html_data" : {"data" :html},
		"themes" : {"theme" : "classic","dots" : true,"icons" :true},
		"core": { "initially_open" : [ "10000"]},
		"languages": [ "zh-cn", "bg" ],
		"plugins" : ["themes", "html_data","ui","languages"]
	}).bind("select_node.jstree", function(e, data){
	var href=data.rslt.obj.attr("rel");
	//alert(href);
	window.parent.document.getElementById("treeRight").src=href;
	//window.parent.document.getElementById("main").src="${approot}/admin/objects/right/"+cid;
   }) 

}

</script>

</head>  
<body>
  <div id="catetree"></div>
</body>
</html>
